package com.shisfish.library.Controller;

import java.util.HashMap;
import java.util.Map;

import javax.ws.rs.FormParam;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;

import com.shisfish.library.Impl.LoanRemindImpl;
import com.shisfish.library.Model.LoanRemind;
import com.shisfish.library.Utils.Global.GlobalVariable;
import com.shisfish.library.Utils.Global.toJsonUtils;

@Path("loanRemind")
public class LoanRemindController extends GlobalVariable {

	private LoanRemindImpl loanRemindImpl = new LoanRemindImpl();
	
	@POST
	@Path("insertOne")
	@Produces("application/json; charset=utf-8")
	public String insertOne(@FormParam("employee") String employee, @FormParam("isbn") String isbn) {
		Map<String, Object> globalMap = new HashMap<String, Object>();
		
		LoanRemind loanRemind = new LoanRemind(employee, isbn);
		
		loanRemindImpl.insertOne(loanRemind);
		
		return toJsonUtils.map2Json(globalMap);
	}
	
}
